package ru.inse.job.web.module;

import java.util.Map;

import ru.inse.job.web.page.JobComponentFactory;
import ru.inse.job.web.page.JobPageFactory;
import ru.inse.web.module.IInseModuleRegisterService;
import ru.inse.web.module.InseModule;
import ru.xeden.web.html.module.AbstractModule;

public class JobModule
    extends AbstractModule
{
    
    public static final String ID = "job";
    private InseModule inseModule;

    public JobModule()
    {
        setPageFactory(new JobPageFactory());
        setComponentFactory(new JobComponentFactory());
    }

    @Override
    public String getDisplayName()
    {
        return "Работа";
    }

    @Override
    public String getId()
    {
        return ID;
    }

    @Override
    public String getUrlPiece()
    {
        return "job";
    }

    @Override
    public int getDisplayOrder()
    {
        return 1;
    }
    
    // InseModuleRegisterService -----------------------------------------------------
    
    public void inseModuleRegisterServiceBind(IInseModuleRegisterService registerService, Map properties)
    {
        registerService.register(this);
        this.inseModule = registerService.getInseModule();
    }
    
    public void inseModuleRegisterServiceUnbind(IInseModuleRegisterService registerService, Map properties)
    {
        registerService.unregister(this);
        this.inseModule = null;
    }

    public InseModule getInseModule()
    {
        return inseModule;
    }

}
